//
//  DataBase.h
//  FMDBDemo
//
//  Created by Zeno on 16/5/18.
//  Copyright © 2016年 zenoV. All rights reserved.
//

#import <Foundation/Foundation.h>
@class KACategoryModel;
@class KAAccountModel;
@class KAUserinfoModel;
@class KABadgeModel;
@class KAChartModel;
@class KAAccountGroupModel;

typedef enum : NSUInteger {
    DataTypeThisWeek,
    DataTypeThisMonth,
    DataTypeThisYear,
} DataType;


@interface KADataBase : NSObject


+ (instancetype)sharedDataBase;


#pragma mark - Person
/**  添加accountModel */
- (void)addAccountModel:(KAAccountModel *)accountModel;
/**  删除accountModel */
- (void)deleteAccount:(KAAccountModel *)KAAccountModel;
/** 更新accountModel */
- (void)updateAccount:(KAAccountModel *)accountModel;
/** 查询某个月的数据 */
- (NSMutableArray<KAAccountModel *> *)getAccountModelWithYear:(NSString *)year month:(NSString *)month;

/**
 *  获取所有类别
 *
 */
- (NSMutableArray<KACategoryModel *> *)getAllCategoryModel;
/**
 *  根据type获取类别
 *
 */
- (NSMutableArray<KACategoryModel *> *)getCategoryModelWithType:(NSInteger)type;

#pragma mark - UserInfo
/** 更新person */
- (void)updateUserinfo:(KAUserinfoModel *)userinfoModel;
/** 获取person的所有车辆 */
- (KAUserinfoModel *)getUserinfo;

#pragma mark - badge
/**
 *  获取所有徽章
 *
 */
- (NSMutableArray<KABadgeModel *> *)getAllBadgeModel;
/**
 *  根据type获取徽章
 *
 */
- (NSMutableArray<KABadgeModel *> *)getBadgeModelsWithType:(NSInteger)type;
/**
 *  更新徽章
 *
 */
- (void)updateBadgeWithType:(NSInteger)type;


#pragma mark - KAChartModel
- (NSMutableArray<KAChartModel *> *)getModelArrayWithDataType:(DataType)dataType type:(NSInteger)type;
- (NSMutableArray<KAAccountGroupModel *> *)getGroupModelArrayWithDataType:(DataType)dataType type:(NSInteger)type;

@end
